<?PHP
require_once("./include/membersite_config.php");

if(isset($_POST['submitted']))
{
   if($fgmembersite->Login())
   {
        $fgmembersite->RedirectToURL("login-home.php");
   }
}

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
<meta http-equiv="Content-Language" content="zh-CN" > 
<meta name="keywords" content="海外，圈子，华人，活动" >
<meta name="Description" content="来结实更多的朋友吧" >
<title>个人主页</title>
<link rel="shortcut icon" href="./images/logo_mini.png">

<link href="./style/style_lei.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div class="container">
  <div class="banner">
      <div class="bannerunit">
      <!--units for banner-->
			<div class="bunits"><img src="./space/picforwebsite/banner.jpg" width="222" height="68" alt="logo" /></div>
			<div class="bannerbutton">
			  <ul>
			    <li><a href="#">首页</a></li>
			    <li><a href="#">个人</a></li>
			    <li><a href="#">活动</a></li>
		      </ul>
			</div>
      </div>
    </div>

    <!--The banner-->
  		<div class="nav">

        </div>
    <div class="profile">
    <div class="rightspace">基本信息</div>
    <div class="sep"></div> 
    <div class="blog">
     	<form action="form_action.asp" method="get">
     	  姓名：
          <input type="text" name="fname" /><br />
 		昵称： 
 		<input type="text" name="username" /><br />
 		性别：
        <input type="text" name="sex" /><br />
  		生日：
  		<input type="text" name="birthday" /><br />
  		</form>
    
    </div>
      <div class="rightspace">学校信息</div>
    <div class="sep"></div> 
    <div class="blog">
    	<form action="form_action.asp" method="get">
    	  学校名称：
            <input type="text" name="schoolId" /><br />
            学   历：		
            <input type="text" name="degreeLevel" /><br />
          专业：
          <input type="text" name="major" /><br />
          所在州：
          <input type="text" name="state" /><br />
  		所在城市： 
  		<input type="text" name="city" /><br />
        
  		</form></div>
    <div class="rightspace">个人信息</div>
    <div class="sep"></div> 
    <div class="blog">
      <form action="form_action.asp" method="get">
        婚姻状态： 
  		  <input type="text" name="marriage" /><br />
	    个人说明：
        <input type="text" name="personal" /><br />
  		邮箱： 
  		<input type="text" name="email" /><br />
      </form> 
      </div>  

<input type="submit" value="Submit" />

  		</form>   <div class="sep"></div> 
           </div>
    
 
  	<div class="right"> 
  	</div>
  <div class="footer"> </div>1
</div>
<?php
    $connection = mysql_connect("localhost","username","pwd");
	if (!$connection) {
        die('Could not connect: ' . mysql_error());
    }
	echo 'Connected successfully';
	$db_selected = mysql_select_db("hs_user",$connection);
	if (!$db_selected) {
		die('canot use foo: '. mysql_error());
	}
	//insert into the database hs_user
	$strSql="insert into reguser(firstName,username,sex,birthday,email)
		 values('$fname','$username',$sex,'$birthday','$email')";
	$result=mysql_query($strSql,$connection) or die(mysql_error());
		 
	$db_selected = mysql_select_db("hs_userSchool",$connection);
	if (!$db_selected) {
		die('canot use foo: '. mysql_error());
	}		 
	$strSql="insert into reguser(schoolId,degreeLevel,major)
		 values('$schoolId','$degreeLevel','$major')";
	$result=mysql_query($strSql,$connection) or die(mysql_error());	

	$db_selected = mysql_select_db("hs_location",$connection);
	if (!$db_selected) {
		die('canot use foo: '. mysql_error());
	}		 
	$strSql="insert into reguser(locationState,locationCity)
		 values('$state','$city')";	
	$result=mysql_query($strSql,$connection) or die(mysql_error());
	mysql_close($myconn);
    

?>
</body>
</html>
